// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.

// This code was generated by google-apis-code-generator 1.5.1

// ----------------------------------------------------------------------------
// NOTE: This file is generated from Google APIs Discovery Service.
// Service:
//   Cloud Storage JSON API (storage/v1)
// Generated from:
//   Version: v1
//   Revision: 20171004
// Generated by:
//    Tool: google-apis-code-generator 1.5.1
//     C++: 0.1.5
#ifndef  GOOGLE_STORAGE_API_COMPOSE_REQUEST_H_
#define  GOOGLE_STORAGE_API_COMPOSE_REQUEST_H_

#include <string>
#include "googleapis/base/integral_types.h"
#include "googleapis/base/macros.h"
#include "googleapis/client/data/jsoncpp_data.h"
#include "googleapis/strings/stringpiece.h"

#include "google/storage_api/object.h"

namespace Json {
class Value;
}  // namespace Json

namespace google_storage_api {
using namespace googleapis;

/**
 * A Compose request.
 *
 * @ingroup DataObject
 */
class ComposeRequest : public client::JsonCppData {
 public:
  /**
   * No description provided.
   *
   * @ingroup DataObject
   */
  class ComposeRequestSourceObjects : public client::JsonCppData {
   public:
    /**
     * Conditions that must be met for this operation to execute.
     *
     * @ingroup DataObject
     */
    class ComposeRequestSourceObjectsObjectPreconditions : public client::JsonCppData {
     public:
      /**
       * Creates a new default instance.
       *
       * @return Ownership is passed back to the caller.
       */
      static ComposeRequestSourceObjectsObjectPreconditions* New();

      /**
       * Standard constructor for an immutable data object instance.
       *
       * @param[in] storage  The underlying data storage for this instance.
       */
      explicit ComposeRequestSourceObjectsObjectPreconditions(const Json::Value& storage);

      /**
       * Standard constructor for a mutable data object instance.
       *
       * @param[in] storage  The underlying data storage for this instance.
       */
      explicit ComposeRequestSourceObjectsObjectPreconditions(Json::Value* storage);

      /**
       * Standard destructor.
       */
      virtual ~ComposeRequestSourceObjectsObjectPreconditions();

      /**
       * Returns a string denoting the type of this data object.
       *
       * @return <code>google_storage_api::ComposeRequestSourceObjectsObjectPrec
       * onditions</code>
       */
      const char* GetTypeName() const {
        return "google_storage_api::ComposeRequestSourceObjectsObjectPreconditions";
      }

      /**
       * Determine if the '<code>ifGenerationMatch</code>' attribute was set.
       *
       * @return true if the '<code>ifGenerationMatch</code>' attribute was set.
       */
      bool has_if_generation_match() const {
        return Storage().isMember("ifGenerationMatch");
      }

      /**
       * Clears the '<code>ifGenerationMatch</code>' attribute.
       */
      void clear_if_generation_match() {
        MutableStorage()->removeMember("ifGenerationMatch");
      }


      /**
       * Get the value of the '<code>ifGenerationMatch</code>' attribute.
       */
      int64 get_if_generation_match() const {
        const Json::Value& storage = Storage("ifGenerationMatch");
        return client::JsonValueToCppValueHelper<int64 >(storage);
      }

      /**
       * Change the '<code>ifGenerationMatch</code>' attribute.
       *
       * Only perform the composition if the generation of the source object
       * that would be used matches this value. If this value and a generation
       * are both specified, they must be the same value or the call will fail.
       *
       * @param[in] value The new value.
       */
      void set_if_generation_match(int64 value) {
        client::SetJsonValueFromCppValueHelper<int64 >(
          value, MutableStorage("ifGenerationMatch"));
      }

     private:
      void operator=(const ComposeRequestSourceObjectsObjectPreconditions&);
    };  // ComposeRequestSourceObjectsObjectPreconditions
    /**
     * Creates a new default instance.
     *
     * @return Ownership is passed back to the caller.
     */
    static ComposeRequestSourceObjects* New();

    /**
     * Standard constructor for an immutable data object instance.
     *
     * @param[in] storage  The underlying data storage for this instance.
     */
    explicit ComposeRequestSourceObjects(const Json::Value& storage);

    /**
     * Standard constructor for a mutable data object instance.
     *
     * @param[in] storage  The underlying data storage for this instance.
     */
    explicit ComposeRequestSourceObjects(Json::Value* storage);

    /**
     * Standard destructor.
     */
    virtual ~ComposeRequestSourceObjects();

    /**
     * Returns a string denoting the type of this data object.
     *
     * @return <code>google_storage_api::ComposeRequestSourceObjects</code>
     */
    const char* GetTypeName() const {
      return "google_storage_api::ComposeRequestSourceObjects";
    }

    /**
     * Determine if the '<code>generation</code>' attribute was set.
     *
     * @return true if the '<code>generation</code>' attribute was set.
     */
    bool has_generation() const {
      return Storage().isMember("generation");
    }

    /**
     * Clears the '<code>generation</code>' attribute.
     */
    void clear_generation() {
      MutableStorage()->removeMember("generation");
    }


    /**
     * Get the value of the '<code>generation</code>' attribute.
     */
    int64 get_generation() const {
      const Json::Value& storage = Storage("generation");
      return client::JsonValueToCppValueHelper<int64 >(storage);
    }

    /**
     * Change the '<code>generation</code>' attribute.
     *
     * The generation of this object to use as the source.
     *
     * @param[in] value The new value.
     */
    void set_generation(int64 value) {
      client::SetJsonValueFromCppValueHelper<int64 >(
        value, MutableStorage("generation"));
    }

    /**
     * Determine if the '<code>name</code>' attribute was set.
     *
     * @return true if the '<code>name</code>' attribute was set.
     */
    bool has_name() const {
      return Storage().isMember("name");
    }

    /**
     * Clears the '<code>name</code>' attribute.
     */
    void clear_name() {
      MutableStorage()->removeMember("name");
    }


    /**
     * Get the value of the '<code>name</code>' attribute.
     */
    const StringPiece get_name() const {
      const Json::Value& v = Storage("name");
      if (v == Json::Value::null) return StringPiece("");
      return StringPiece(v.asCString());
    }

    /**
     * Change the '<code>name</code>' attribute.
     *
     * The source object's name. The source object's bucket is implicitly the
     * destination bucket.
     *
     * @param[in] value The new value.
     */
    void set_name(const StringPiece& value) {
      *MutableStorage("name") = value.data();
    }

    /**
     * Determine if the '<code>objectPreconditions</code>' attribute was set.
     *
     * @return true if the '<code>objectPreconditions</code>' attribute was set.
     */
    bool has_object_preconditions() const {
      return Storage().isMember("objectPreconditions");
    }

    /**
     * Clears the '<code>objectPreconditions</code>' attribute.
     */
    void clear_object_preconditions() {
      MutableStorage()->removeMember("objectPreconditions");
    }


    /**
     * Get a reference to the value of the '<code>objectPreconditions</code>'
     * attribute.
     */
    const ComposeRequestSourceObjectsObjectPreconditions get_object_preconditions() const {
       const Json::Value& storage = Storage("objectPreconditions");
      return client::JsonValueToCppValueHelper<ComposeRequestSourceObjectsObjectPreconditions >(storage);
    }

    /**
     * Gets a reference to a mutable value of the
     * '<code>objectPreconditions</code>' property.
     *
     * Conditions that must be met for this operation to execute.
     *
     * @return The result can be modified to change the attribute value.
     */
    ComposeRequestSourceObjectsObjectPreconditions mutable_objectPreconditions() {
      Json::Value* storage = MutableStorage("objectPreconditions");
      return client::JsonValueToMutableCppValueHelper<ComposeRequestSourceObjectsObjectPreconditions >(storage);
    }

   private:
    void operator=(const ComposeRequestSourceObjects&);
  };  // ComposeRequestSourceObjects
  /**
   * Creates a new default instance.
   *
   * @return Ownership is passed back to the caller.
   */
  static ComposeRequest* New();

  /**
   * Standard constructor for an immutable data object instance.
   *
   * @param[in] storage  The underlying data storage for this instance.
   */
  explicit ComposeRequest(const Json::Value& storage);

  /**
   * Standard constructor for a mutable data object instance.
   *
   * @param[in] storage  The underlying data storage for this instance.
   */
  explicit ComposeRequest(Json::Value* storage);

  /**
   * Standard destructor.
   */
  virtual ~ComposeRequest();

  /**
   * Returns a string denoting the type of this data object.
   *
   * @return <code>google_storage_api::ComposeRequest</code>
   */
  const char* GetTypeName() const {
    return "google_storage_api::ComposeRequest";
  }

  /**
   * Determine if the '<code>destination</code>' attribute was set.
   *
   * @return true if the '<code>destination</code>' attribute was set.
   */
  bool has_destination() const {
    return Storage().isMember("destination");
  }

  /**
   * Clears the '<code>destination</code>' attribute.
   */
  void clear_destination() {
    MutableStorage()->removeMember("destination");
  }


  /**
   * Get a reference to the value of the '<code>destination</code>' attribute.
   */
  const Object get_destination() const;

  /**
   * Gets a reference to a mutable value of the '<code>destination</code>'
   * property.
   *
   * Properties of the resulting object.
   *
   * @return The result can be modified to change the attribute value.
   */
  Object mutable_destination();

  /**
   * Determine if the '<code>kind</code>' attribute was set.
   *
   * @return true if the '<code>kind</code>' attribute was set.
   */
  bool has_kind() const {
    return Storage().isMember("kind");
  }

  /**
   * Clears the '<code>kind</code>' attribute.
   */
  void clear_kind() {
    MutableStorage()->removeMember("kind");
  }


  /**
   * Get the value of the '<code>kind</code>' attribute.
   */
  const StringPiece get_kind() const {
    const Json::Value& v = Storage("kind");
    if (v == Json::Value::null) return StringPiece("");
    return StringPiece(v.asCString());
  }

  /**
   * Change the '<code>kind</code>' attribute.
   *
   * The kind of item this is.
   *
   * @param[in] value The new value.
   */
  void set_kind(const StringPiece& value) {
    *MutableStorage("kind") = value.data();
  }

  /**
   * Determine if the '<code>sourceObjects</code>' attribute was set.
   *
   * @return true if the '<code>sourceObjects</code>' attribute was set.
   */
  bool has_source_objects() const {
    return Storage().isMember("sourceObjects");
  }

  /**
   * Clears the '<code>sourceObjects</code>' attribute.
   */
  void clear_source_objects() {
    MutableStorage()->removeMember("sourceObjects");
  }


  /**
   * Get a reference to the value of the '<code>sourceObjects</code>' attribute.
   */
  const client::JsonCppArray<ComposeRequestSourceObjects > get_source_objects() const {
     const Json::Value& storage = Storage("sourceObjects");
    return client::JsonValueToCppValueHelper<client::JsonCppArray<ComposeRequestSourceObjects > >(storage);
  }

  /**
   * Gets a reference to a mutable value of the '<code>sourceObjects</code>'
   * property.
   *
   * The list of source objects that will be concatenated into a single object.
   *
   * @return The result can be modified to change the attribute value.
   */
  client::JsonCppArray<ComposeRequestSourceObjects > mutable_sourceObjects() {
    Json::Value* storage = MutableStorage("sourceObjects");
    return client::JsonValueToMutableCppValueHelper<client::JsonCppArray<ComposeRequestSourceObjects > >(storage);
  }

 private:
  void operator=(const ComposeRequest&);
};  // ComposeRequest
}  // namespace google_storage_api
#endif  // GOOGLE_STORAGE_API_COMPOSE_REQUEST_H_
